1. Field of the Invention
The present invention relates to an imaging device having an image sensor including a plurality of imaging pixels and a plurality of focus detection pixels and to an imaging method.
2. Description of the Related Art
A technique has been put into practical use, which arranges, in a part of an image sensor, a focus detection pixel (referred to also as a phase-difference pixel) for detecting a phase difference, obtains phase-difference information from a phase-difference pixel value, and determines a subject distance, thereby carrying out autofocus control. On the other hand, in the case of moving image recording or live-view display, a moving image frame rate is usually acquired by mixing and outputting a plurality of pixel outputs inside an image sensor. In an image sensor having phase-difference pixels arranged therein, the outputs of the phase-difference pixels are mixed which cannot be used, as is, as an image signal.
Then, it is necessary to increase the gain for correcting the insufficient sensitivity due to a narrow opening of a phase-difference pixel and/or to generate an image signal through the interpolation operation from peripheral pixels. However, because the density of pixels (mixed pixels) each formed by mixing outputs of phase-difference pixels becomes higher than before mixing, the scheme for performing interpolation from peripheral pixels causes a degradation in image quality.
In order to prevent such image quality degradation, a technique has been proposed for improving the image quality by estimating, from an image, the gain applied to a mixed pixel and increasing the gain of the mixed pixel (see Japanese patent laid-open 2013-257494 (hereinafter referred to as “Patent Literature 1”)). The gain to be multiplied to a mixed pixel is determined by the aperture ratio of a phase-difference pixel, at the center section of an image, while in the peripheral the gain to be multiplied to a mixed pixel is affected by the pupil position of an optical system, the oblique incidence characteristic of a pixel, and the like and differs from the gain at the center section of the image. This influence depends on the image height in the opening direction (horizontal direction in the case of left and right openings).
The gain multiplied to a mixed pixel value is preferably calculated by comparing the output of a phase-difference pixel and the output of a normal pixel in the peripheral thereof. However, with the technique of Patent Literature 1, when a phase-difference pixel is arranged in a wide area of an image sensor, a pixel with a wide-width area needs to be arranged in the opening direction of the phase difference in order to estimate the gain. When the direction of the phase difference to detect is set not only to the horizontal direction but also to the vertical direction, a phase-difference pixel with an opening of the vertical direction is arranged. In this case, in order to estimate the gain used in correction, a pixel with a wide width needs to be arranged also in the horizontal direction and the vertical direction of the area where the phase-difference pixel is arranged. That is, a pixel with a wide area needs to be arranged for correction of a phase-difference pixel, both in the horizontal direction and in the vertical direction, which causes a significant increase in memories used for calculation and/or an increase in a data transfer quantity.